<?php


namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;
use Cache,Event,Auth;

header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');


class PushController extends Controller
{
	public function jq(request $request){
		

			$map = array(
				'unit_id' => Auth::guard('admin')->user()->unit_id,
				'police_cl' => '1',
				'is_read' => '0', 
			);


			$jq_count = db::table('jqsb')->where($map)->count();

			if ($jq_count > 0) {
				echo 'data:'.$jq_count.chr(0x0a).chr(0x0d).chr(0x0a).chr(0x0d);
				flush();
			}
	}
}